import { AddFormatFunc, typeCalcRuleType } from "../types";

AddFormatFunc<typeCalcRuleType>({

	type: "TYPE_CALC",

	handle: (rule, FMC) => {
		return `${rule[1][0] === "TYPE_CALC" ? `(${FMC(rule[1])})` : FMC(rule[1])}${rule[2].map(item => ` ${item[0]} ${item[1][0] === "TYPE_CALC" ? `(${FMC(item[1])})` : FMC(item[1])}`).join("")}`;
	},

})
